import java.util.Scanner;

public class L05 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[6];
        System.out.println("欢迎各位评委打分");
        for (int i = 0; i < 6; i++) {
            System.out.println("请您输人第"+(i+1)+"个分数");
            int fs=sc.nextInt();
        if (fs>=1 && fs<=100){
            arr[i]=fs;
        }else{
            System.out.println("输入有误");
             i--;
        }
        }
       int max=arr[0];
        for (int i = 0; i <arr.length; i++) {
            if (arr[i]>max) {
             max=arr[i];
            }
        }
        int min=arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] <min ) {
                min= arr[i];
            }
        }
        int sum=0;
                for (int i=0;i<arr.length; i++) {
                sum+=arr[i];

                }
         int avg=(sum-max-min)/4;
        System.out.println("平均数"+avg);


    }
}
